package org.shj.pattern.chainresponsibility

abstract class Staff {
  var successor: Staff = _
  
  def approveRaiseSalary(money: Int)
}

class TeamLeader extends Staff{
  def approveRaiseSalary(money: Int){
    if(money < 200){
      println(s"Team Leader approve raise $money")
    }else{
      successor.approveRaiseSalary(money)
    }
  }
}

class PM extends Staff{
  def approveRaiseSalary(money: Int){
    if(money < 1000){
      println(s"PM approve raise $money")
    }else{
      successor.approveRaiseSalary(money)
    }
  }
}

class Boss extends Staff{
  def approveRaiseSalary(money: Int){
      println(s"Boss approve raise $money")
  }
}